package com.hzy.app.verticle;

import io.vertx.core.AbstractVerticle;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class ConsumerVerticle extends AbstractVerticle {

    private final Logger log = LoggerFactory.getLogger(getClass());

    @Override
    public void start() {
        vertx.eventBus().consumer("my.address", message -> {
            log.info("Received message: {}", message.body());
            message.reply("ok," + getClass().getName() + " accept message: " + message.body());
        });

        log.info("Verticle [{}] started.", getClass().getName());
    }
}
